const { defineConfig } = require("@vue/cli-service");
const path = require("path");
console.log(process.env.VUE_APP_MODE);
const mode = process.env.VUE_APP_MODE;
let config = {
    transpileDependencies: true,
    chainWebpack: (config) => {
        config.module.rule('vue').use('vue-loader').tap((options) => {
            return {
                ...options,
                reactivityTransform: true
            }
        })
        return config;
    },
    configureWebpack: {
    },
};
if (mode === 'library') {
    config = {
        transpileDependencies: true,
        chainWebpack: (config) => {
            config.module.rule('vue').use('vue-loader').tap((options) => {
                return {
                    ...options,
                    reactivityTransform: true
                }
            })
            return config;
        },
        pages: {
            index: {
                entry: path.resolve(__dirname, './packages/index.ts')
            }
        },
        configureWebpack: {
            output: {
                
            }
        },
    }
}
module.exports = defineConfig(config);
